#ifndef __BOA__H__
#define __BOA__H__

#include "cocos-ext.h"
#include "cocos2d.h"
#include "Config.h"

USING_NS_CC;
USING_NS_CC_EXT;
using namespace cocos2d::gui;


class Boa : public CCNode
{
public:
	// Khoi tao con tran voi CCNode
	static Boa * create(CCNode* node);
	bool init(CCNode* node);
	virtual void update(float dt); // update cac action khi trang thai thay doi

	void fPreLoadMusic();

	// Setter vi tri cua con tran
	void fSetPosition(float x, float y);
	void fSetPosition(CCPoint point);
	CCPoint fGetPosition();

	// Setter, Geteter trang thai hien tai cua con tran
	inline void setStatus(BoaStatus status) {m_newState = status;}
	inline int getStatus() {return m_currentStatus;}


	// Quan ly cac hieu ung chuyen dong cua con tran
	void fEffect();

	// Tra ve amature cua con tran CCNode->Armature
	CCArmature* fGetArmature();

	// BOA ACTION

private:

	void onAnimationEvent(CCArmature *pArmature, MovementEventType eventType, const char *animationID); // quan ly cac trang thai cua animation

	CCArmature* m_Armature;
	CCArmatureAnimation* m_Animation;

	// Cac trang thai cua con khi
	BoaStatus m_currentStatus;
	BoaStatus m_newState;
};

#endif //Khi con